/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package praticav.model;

import java.io.Serializable;
import javax.persistence.Embeddable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;

/**
 *
 * @author Jonatah Benatti
 */

@SequenceGenerator(name = "seq_fase",  
                   sequenceName = "seq_fase",  
                   allocationSize = 1)
@Embeddable
public class FasesPK implements Serializable {
    
    
    @GeneratedValue(strategy = GenerationType.SEQUENCE,  
             generator = "seq_fase") 
    private int fascodigo;
    
    @ManyToOne // uma produção pode ter várias fases
    @JoinColumn(name  = "procodigo")
    private Producao producao;

    public int getFascodigo() {
        return fascodigo;
    }

    public void setFascodigo(int fascodigo) {
        this.fascodigo = fascodigo;
    }

    public Producao getProducao() {
        return producao;
    }

    public void setProducao(Producao producao) {
        this.producao = producao;
    }
        
}
